from selenium.webdriver.common.by import By

from base import Base
class Page(Base):
    print('搜索')
    def sosuo(self):
        #android uiautomator
        loc=(By.ANDROID_UIAUTOMATOR,'new UiSelector().text("搜索菜谱")')
        ele=self.flin_ele(loc)
        return ele
    print('输入搜索内容')
    def srssnr(self):
        loc=(By.CLASS_NAME,'android.widget.EditText')
        ele=self.flin_ele(loc)
        return ele
    print('点击搜索')
    def djss(self):
        loc=(By.XPATH,'//android.widget.TextView[@text="搜索"]')
        ele=self.flin_ele(loc)
        return ele
    print('点击图片')
    def djtp(self):
        loc=(By.XPATH,'(//android.widget.ImageView[@resource-id="com.xiachufang:id/common_photo_image_view"])[1]')
        ele=self.flin_ele(loc)
        return ele
    print('点击收藏')
    def djsc(self):
        loc=(By.ID,'com.xiachufang:id/recipe_bto_nav_bar_collect')
        ele=self.flin_ele(loc)
        return ele
    print('点击返回')
    def djfh(self):
        loc = (By.ANDROID_UIAUTOMATOR, 'new UiSelector().description("返回")')
        ele = self.flin_ele(loc)
        return ele
    print('断言：评分最高')
    def pfzg(self):
        loc = (By.ANDROID_UIAUTOMATOR, 'new UiSelector().text("评分最高")')
        ele = self.flin_ele(loc)
        return ele
